package com.igoal.web.model;

import java.util.List;
import java.util.Set;

import org.apache.commons.lang.StringEscapeUtils;

import com.igoal.dto.FriendDTO;
import com.igoal.dto.GoalDTO;
import com.igoal.dto.PotentialFriendDTO;
import com.igoal.dto.UserActivityLogDTO;

public class BaseModel {
	// current user information
	protected String userInSession;
	protected Long userId;
	protected String userAvatar;
	protected String userAlias;
	
	protected SettingsModel settings;
	
	// begin top zone
	protected UserNotificatorModel notificator;
	protected UserStatusModel userStatus;
	protected GoalDTO mustDoGoal;
	// end top zone

	// begin right zone
	protected UpdateCompletenessModel updateCompleteness;
	protected Integer friendCount;
	protected List<FriendDTO> friends;
	protected List<FriendDTO> mutualFriends;
	protected List<PotentialFriendDTO> potentialFriends;
	protected String userBiography;
	protected List<UserActivityLogDTO> activities;
	protected Set<GoalDTO> topGoals;
	protected Set<GoalDTO> commonGoals;
	// end right zone
	
	public Set<GoalDTO> getTopGoals() {
		return topGoals;
	}

	public void setTopGoals(Set<GoalDTO> topGoals) {
		this.topGoals = topGoals;
	}

	public Set<GoalDTO> getCommonGoals() {
		return commonGoals;
	}

	public void setCommonGoals(Set<GoalDTO> commonGoals) {
		this.commonGoals = commonGoals;
	}

	public BaseModel() {
		settings = new SettingsModel();
		friendCount = 0;		
	}

	public UpdateCompletenessModel getUpdateCompleteness() {
		return updateCompleteness;
	}

	public void setUpdateCompleteness(UpdateCompletenessModel updateCompleteness) {
		this.updateCompleteness = updateCompleteness;
	}

	public UserNotificatorModel getNotificator() {
		return notificator;
	}

	public void setNotificator(UserNotificatorModel notificator) {
		this.notificator = notificator;
	}

	public List<FriendDTO> getFriends() {
		return friends;
	}

	public void setFriends(List<FriendDTO> friends) {
		this.friends = friends;
	}

	public Integer getFriendCount() {
		return friendCount;
	}

	public void setFriendCount(Integer friendCount) {
		this.friendCount = friendCount;
	}

	public List<FriendDTO> getMutualFriends() {
		return mutualFriends;
	}

	public void setMutualFriends(List<FriendDTO> mutualFriends) {
		this.mutualFriends = mutualFriends;
	}

	public String getUserBiography() {
		return userBiography;
	}

	public void setUserBiography(String userBiography) {
		if(userBiography != null){
			userBiography = StringEscapeUtils.escapeHtml(userBiography);
		}
		this.userBiography = userBiography;
	}

	public String getUserInSession() {
		return userInSession;
	}

	public void setUserInSession(String userInSession) {
		this.userInSession = userInSession;
	}

	public Long getUserId() {
		return userId;
	}

	public void setUserId(Long userId) {
		this.userId = userId;
	}

	public String getUserAvatar() {
		return userAvatar;
	}

	public void setUserAvatar(String userAvatar) {
		this.userAvatar = userAvatar;
	}

	public String getUserAlias() {
		return userAlias;
	}

	public void setUserAlias(String userAlias) {
		this.userAlias = userAlias;
	}

	public List<PotentialFriendDTO> getPotentialFriends() {
		return potentialFriends;
	}

	public void setPotentialFriends(List<PotentialFriendDTO> potentialFriends) {
		this.potentialFriends = potentialFriends;
	}

	public SettingsModel getSettings() {
		return settings;
	}

	public void setSettings(SettingsModel settings) {
		this.settings = settings;
	}

	public UserStatusModel getUserStatus() {
		return userStatus;
	}

	public void setUserStatus(UserStatusModel userStatus) {
		this.userStatus = userStatus;
	}

	public List<UserActivityLogDTO> getActivities() {
		return activities;
	}

	public void setActivities(List<UserActivityLogDTO> activities) {
		this.activities = activities;
	}

	public GoalDTO getMustDoGoal() {
		return mustDoGoal;
	}

	public void setMustDoGoal(GoalDTO mustDoGoal) {
		this.mustDoGoal = mustDoGoal;
	}
}
